home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
An Invitation to the Roland World of Music
/
Roland - An Invitation To The Roland World Of Music.bin
/
vb
/
mmsystem
/
mmsys1
/
form1.frm
next >
Wrap
Text File
|
1995-04-22
|
5KB
|
184 lines
VERSION 2.00
Begin Form main
Caption = "Form1"
ClientHeight = 3240
ClientLeft = 1125
ClientTop = 1605
ClientWidth = 7425
Height = 3645
Left = 1065
LinkTopic = "Form1"
ScaleHeight = 3240
ScaleWidth = 7425
Top = 1260
Width = 7545
Begin PictureBox Bender
DrawMode = 6 'Invert
Height = 2895
Left = 6360
ScaleHeight = 16383
ScaleMode = 0 'User
ScaleWidth = 1
TabIndex = 9
Top = 300
Width = 975
End
Begin ListBox lst_sound_list
Height = 2175
Left = 2940
TabIndex = 5
Top = 1020
Width = 2175
End
Begin CommandButton Command2
Caption = "All Sound Off"
Height = 495
Left = 1680
TabIndex = 2
Top = 60
Width = 1755
End
Begin PictureBox Picture1
Height = 2895
Left = 5760
ScaleHeight = 127
ScaleMode = 0 'User
ScaleWidth = 405
TabIndex = 4
Top = 300
Width = 435
End
Begin VScrollBar sb_play
Height = 2895
LargeChange = 12
Left = 5220
Max = 127
TabIndex = 3
Top = 300
Width = 435
End
Begin CommandButton Command1
Caption = "Play Note C4"
Height = 495
Left = 60
TabIndex = 1
Top = 60
Width = 1515
End
Begin ListBox List1
Height = 2175
Left = 60
TabIndex = 0
Top = 1020
Width = 2835
End
Begin Label Label4
AutoSize = -1 'True
Caption = "Bender"
Height = 195
Left = 6360
TabIndex = 10
Top = 60
Width = 615
End
Begin Label Label3
AutoSize = -1 'True
Caption = "Play here"
Height = 195
Left = 5220
TabIndex = 6
Top = 60
Width = 810
End
Begin Label Label2
AutoSize = -1 'True
Caption = "Sounds"
Height = 195
Left = 2940
TabIndex = 8
Top = 720
Width = 645
End
Begin Label Label1
AutoSize = -1 'True
Caption = "Devices"
Height = 195
Left = 120
TabIndex = 7
Top = 660
Width = 705
End
End
Option Explicit
Sub Bender_MouseMove (Button As Integer, Shift As Integer, x As Single, y As Single)
Static last_y_value As Single
' Remove previous line by overdrawing with inverted draw mode
' scale width set from 0 to 1
bender.Line (0, last_y_value)-(1, last_y_value)
Call bender(0, y) ' scaleheight set to 0 to 16383
' Draw new line
bender.Line (0, y)-(1, y)
last_y_value = y
End Sub
Sub Command1_Click ()
Call note_on(0, 60, 127)
End Sub
Sub Command2_Click ()
all_sounds_off
End Sub
Sub fill_sound_list ()
Dim s As String
Open app.Path & "\genmidi.txt" For Input As #1
Do While Not EOF(1)
Line Input #1, s
lst_sound_list.AddItem s
Loop
Close #1
End Sub
Sub Form_Load ()
Call midi_listoutdevs(list1)
Call fill_sound_list
End Sub
Sub Form_Unload (Cancel As Integer)
midi_out_close
End Sub
Sub List1_Click ()
Dim x As Integer
midi_out_close
x = midi_out_open(list1.ItemData(list1.ListIndex))
End Sub
Sub lst_sound_list_Click ()
Call program_change(0, 0, lst_sound_list.ListIndex)
End Sub
Sub Picture1_MouseDown (Button As Integer, Shift As Integer, x As Single, y As Single)
Call note_on(0, y, 127)
End Sub
Sub Picture1_MouseUp (Button As Integer, Shift As Integer, x As Single, y As Single)
Call note_off(0, y)
End Sub
Sub sb_play_Change ()
Static prev_note As Integer ' remember variable (static)
' Turn off previous note
Call note_off(0, prev_note)
' turn on this note
Call note_on(0, sb_play.Value, 127) ' Max velocity
' save note as previous
prev_note = sb_play.Value
End Sub